//run.cpp
#include <iostream>
#include "mySort.h"
using namespace std;


int main() {
    void(*p1)(int *a, int) = &sortByDesc;
    void(*p2)(int *a, int) = &sortByAsce;
    void(*p3)(int *a, int) = &sortByAbsAsce;
    void(*p4)(int *a, int) = &sortByAbsDesc;
    //const int n = 10;
    int a[] = {2378, 32678, 3467, 45, 848, 1784, 4897,
        -48946, 4987, 78, -1, -8, -100, -15, -2343};
    int n = sizeof(a) / sizeof(int);
    cout << "原数组：" << endl;
    printArray(a, n);
    my_sort(a, n, p1);
    cout << "降序：" << endl;
    printArray(a, n);
    my_sort(a, n, p2);
    cout << "升序：" << endl;
    printArray(a, n);
    my_sort(a, n, p3);
    cout << "按绝对值升序：" << endl;
    printArray(a, n);
    my_sort(a, n, p4);
    cout << "按绝对值降序：" << endl;
    printArray(a, n);
    return 0;
}